<template>
<div>
  <h2>这是Count</h2>
<!--错误写法:子组件不能直接更改父组件中的数据-->
<!--  <button @click="count++">查看</button> -->
  <button @click="changeCount(2)">查看父组件传过来的一个方法</button>
  <button @click="add">查看组件实例</button>
  <p class="count">{{count}}</p>
</div>
</template>


<script>
export default {
  name:"count",
  data(){
    return{
      count1:this.count,
    }
  },
  props:["count","changeCount"],
  methods:{
    add(){
      console.log(this);
      console.log(this.count)
      console.log(this.$props)
    }
  }
}
</script>


<style scoped>
</style>